import torch
import torch.nn as nn

embedding = nn.Embedding(4, 3)
print("权重矩阵 E:\n", embedding.weight)

for i in range(4):
    print(f"索引 {i} →", embedding(torch.LongTensor([i])))
